<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background-color: #eee;
        }
    </style>
</head>

<body>
    <button id="btn-dbl">双击事件</button>
    <hr>
    <div class="box"></div>
    <script>
        var btnDbl = document.querySelector('#btn-dbl')
        var box = document.querySelector('.box')

        btnDbl.ondblclick = function () {
            console.log('双击事件被触发了');
        }
        // 注册鼠标经过事件
        box.onmouseover = function () {
            console.log('onmouseover');
        }
        // 注册鼠标进入事件
        box.onmouseenter = function () {
            console.log('onmouseenter');
        }

        // 注册鼠标离开
        box.onmouseout = function () {
            console.log('onmouseout');
        }
        // 注册鼠标离开
        box.onmouseleave = function () {
            console.log('onmouseleave');
        }
    </script>
</body>

</html>